package day26;

import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;

public class Homework2 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Object array = Array.newInstance(String.class, 5);
        Array.set(array,0,"A");
        Array.set(array,1,"B");
        Array.set(array,2,"C");
        for (int i = 0; i < Array.getLength(array); i++) {
            System.out.println(Array.get(array, i));
        }
    }
}
